home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows2 / hp22d3.zip / REFGUIDE / WHATSHAP.TXT < prev   
Text File  |  1991-05-16  |  13KB  |  322 lines

  1.  
  2.  
  3.  
  4.  
  5.     ________________________________________________________________________
  6.                                  Chapter 1: What's Really Happening   5
  7.     ________________________________________________________________________
  8.  
  9.  
  10.     CHAPTER ONE:  WHAT'S REALLY HAPPENING?
  11.  
  12.     Until now, you may have only used HyperPAD and its applications (the
  13.     pads) to simplify your computing environment. Pad users do not
  14.     necessarily need to understand the inner workings of HyperPAD. They just
  15.     type into fields and push buttons.
  16.  
  17.     As a pad author, you will explore the internal workings of the Browser
  18.     and learn to control your applications by writing scripts using the
  19.     PADtalk scripting language. You will also be introduced to the message
  20.     passing system which controls execution of these scripts.
  21.  
  22.     Let's take a quick look at a pad from an authoring perspective.
  23.  
  24.     Each pad is made up of a number of screens which the user interacts with
  25.     by pressing keys, moving the mouse, and clicking mouse buttons. Each of
  26.     these user-initiated events is translated into a message and sent to the
  27.     objects that make up HyperPAD. For example, if you select a button by
  28.     pressing ENTER, the select message is sent to that button.
  29.  
  30.  ┌───────────────────────────────────────────────────────────────────────┐
  31.  │                                                                       │
  32.  │ **** The Printed Documentation has a picture or screen shot here **** │
  33.  │                                                                       │
  34.  └───────────────────────────────────────────────────────────────────────┘
  35.     
  36.  
  37.  
  38.  
  39.     ________________________________________________________________________
  40.                                  Chapter 1: What's Really Happening   6
  41.     ________________________________________________________________________
  42.  
  43.  
  44.     When an object receives a message, one of two things will occur. The
  45.     object will either ignore the message because you haven't defined any
  46.     actions to be executed when that message is received, or the object will
  47.     execute preassigned actions. As you will learn, an object only performs
  48.     actions defined in its script.
  49.  
  50.  
  51.     WHAT IS PADTALK?
  52.  
  53.     As a pad author, you will use PADtalk scripts to define the actions that
  54.     occur when objects receive certain messages. For example, when the Home
  55.     button is selected by pressing ENTER, the select message is sent to the
  56.     Home button, telling it that it has been selected. Since the button's
  57.     script understands this message, the statements in the script are
  58.     executed and the Home pad is opened and displayed.
  59.  
  60.     You will create your scripts using the HyperPAD language called PADtalk.
  61.     Unlike most programming languages, it is understandable and English-
  62.     like. Even non-programmers can understand and use PADtalk.
  63.  
  64.  ┌───────────────────────────────────────────────────────────────────────┐
  65.  │                                                                       │
  66.  │ **** The Printed Documentation has a picture or screen shot here **** │
  67.  │                                                                       │
  68.  └───────────────────────────────────────────────────────────────────────┘
  69.     
  70.  
  71.  
  72.  
  73.     ________________________________________________________________________
  74.                                  Chapter 1: What's Really Happening   7
  75.     ________________________________________________________________________
  76.  
  77.  
  78.     WHAT DO YOU USE IT FOR?
  79.  
  80.     Some general types of applications you can create with PADtalk and
  81.     HyperPAD are:
  82.  
  83.         0  PC interfaces for launching DOS and Windows programs
  84.  
  85.         0  Customized DOS shells for managing files and directories
  86.  
  87.         0  Interactive computer-based training systems
  88.  
  89.         0  Information bases
  90.  
  91.         0  Software prototypes
  92.  
  93.         0  Front ends for corporate information systems
  94.  
  95.     In order to create your own applications using PADtalk, you must
  96.     understand objects, their relationship to each other, message passing,
  97.     and the object hierarchy. Therefore, it is very important to understand
  98.     the material in this chapter and the two chapters that follow:  "PADtalk
  99.     Scripts" and "The Object Hierarchy."
  100.  
  101.     Before exploring the object hierarchy, we will discuss the family of
  102.     HyperPAD objects and introduce you to its members.
  103.  
  104.  
  105.     OBJECTS
  106.  
  107.     Generally, an object is something that receives and responds to
  108.     messages. All HyperPAD objects have properties that allow you to modify
  109.     their visual appearance and behavior. You can alter the properties of
  110.     objects, including object scripts, with the Info dialog boxes accessible
  111.     through the Objects menu.
  112.  
  113.     Buttons, fields, pages, backgrounds, pads and even HyperPAD itself are
  114.     objects, receiving and passing messages. Messages travel between objects
  115.     along a predetermined path called the object hierarchy. Below, we will
  116.     discuss the objects, the hierarchy into which they're arranged and the
  117.     HyperPAD environment.
  118.  
  119.  
  120.     PAD
  121.  
  122.     The word "pad" is an acronym for Personal Application Design. Pads are
  123.     the basic HyperPAD file structure. All applications designed with
  124.     HyperPAD, several dozen of which came in your package, are pads. Each
  125.     pad is made up of at least one background and one page.
  126.  
  127.  
  128.  
  129.     ________________________________________________________________________
  130.                                  Chapter 1: What's Really Happening   8
  131.     ________________________________________________________________________
  132.  
  133.  
  134.     BACKGROUND
  135.  
  136.     Backgrounds contain those elements (buttons, fields, text, and paint)
  137.     that recur on numerous pages throughout the pad. For example, if you
  138.     want your pad's users to be able to quit from every page in your pad,
  139.     you may place a Quit button on the background(s) in that pad.
  140.     Backgrounds can also serve as templates for pads, defining where
  141.     information is placed and what the pad looks like, since each page is
  142.     overlaid on top of a background.
  143.  
  144.  
  145.     PAGE
  146.  
  147.     Pages form the bulk of a pad and in general display the pad's
  148.     information. Pages contain elements (text, paint, buttons, and fields)
  149.     that are unique to that page. Furthermore, pages contain all the text
  150.     from both background and page fields.
  151.  
  152.  
  153.     FIELD
  154.  
  155.     A field is a container used to display or retrieve textual information.
  156.     Although each field is placed on its own transparent layer, it "belongs"
  157.     to either a page or a background. Regardless of where the field is
  158.     located, the information it holds is always stored on the page.
  159.  
  160.  
  161.     BUTTON
  162.  
  163.     Buttons are objects that respond to user input by executing some pre-
  164.     defined action(s). Each button is placed on its own layer, which belongs
  165.     to either a page or a background.
  166.  
  167.  
  168.     OTHER HYPERPAD OBJECTS
  169.  
  170.     HyperPAD also contains the following objects: menu bar, status bar,
  171.     message box and tool box.
  172.  
  173.  
  174.     HOW TO REFER TO OBJECTS
  175.  
  176.     When writing scripts, you can refer to all objects, except pads, by
  177.     name, number, or ID. Pads must be referred to by their DOS filename. In
  178.     the sections below, each method is described.
  179.  
  180.  
  181.     QUALIFYING OBJECTS
  182.  
  183.     When referring to objects, you may need to specify where they are in
  184.     your pad. For example, if you want to change the color of a button, you
  185.     must specify whether the button is on the page or the background:
  186.  
  187.  
  188.  
  189.     ________________________________________________________________________
  190.                                  Chapter 1: What's Really Happening   9
  191.     ________________________________________________________________________
  192.  
  193.  
  194.     set the color of page button 1 to red;
  195.     set the color of background button 1 to red;
  196.  
  197.     If you do not specify the whereabouts of a button or field, HyperPAD
  198.     assumes you want the one on the background. Thus, the following
  199.     statements refer to the same object:
  200.  
  201.     set the color of field 1 to red;
  202.     set the color of background field 1 to red;
  203.  
  204.     When referring to a page, you may need to specify what background the
  205.     page is on:
  206.  
  207.     go to page 1;
  208.     go to page 1 of background 2;
  209.  
  210.     If you do not specify which background a page belongs to, HyperPAD
  211.     assumes you want the one nearest the front of the pad. For example,
  212.     "page 1" and "page 1 of background 2" are not necessarily the same page.
  213.  
  214.  
  215.     OBJECT NAMES
  216.  
  217.     Although names are optional for all objects except pads, it is usually
  218.     helpful to give your objects a name that describes their purpose. That
  219.     way, it's easy to refer to them from within a script.
  220.  
  221.  
  222.     To modify an object name in the Object Info dialog box:
  223.  
  224.     1.  Select the Pad, Bkgnd, Page, Button, or Field Info command from the
  225.     Objects menu.
  226.  
  227.     2.  Highlight the Name text box and type in the object's name.
  228.  
  229.     3.  Select the << Ok >> button.
  230.  
  231.     Once a name is assigned to an object, you can use that name in a script.
  232.     For example:
  233.  
  234.     go to pad "C:\MYPAD.PAD";
  235.     set the color to page button "Last Name" to red;
  236.     put "wow" into page field "Expression";
  237.     go to page "Preferences";
  238.     go to page "Setup" of background "Options";
  239.  
  240.     Note: When using an object's name in a script, you must enclose it in
  241.     quotation marks.
  242.  
  243.  
  244.  
  245.     ________________________________________________________________________
  246.                                  Chapter 1: What's Really Happening   10
  247.     ________________________________________________________________________
  248.  
  249.  
  250.     OBJECT NUMBERS
  251.  
  252.     Each object within a pad can be referred to by a number based on its
  253.     position relative to the other objects in its class. For example, page 1
  254.     is the first page in a pad. As you edit your pads by copying, cutting,
  255.     pasting, and creating pages, the numbers of the pages will change to
  256.     reflect their new positions.
  257.  
  258.     Backgrounds are assigned an object number based on the order of their
  259.     creation. For example, background 1 was the first background created
  260.     when you selected New Pad. Background numbers change only if you delete
  261.     a background from a pad by deleting each page belonging to that
  262.     background.
  263.  
  264.     Buttons and fields are assigned object numbers corresponding to their
  265.     layer on either the page or background. The object layer closest to the
  266.     page or to the background is assigned the number 1 (i.e. page field 1,
  267.     page button 1). As you use the Cut, Copy, Bring Closer and Send Farther
  268.     commands, the object numbers assigned to the buttons and fields are
  269.     altered to reflect their new positions.
  270.  
  271.  ┌───────────────────────────────────────────────────────────────────────┐
  272.  │                                                                       │
  273.  │ **** The Printed Documentation has a picture or screen shot here **** │
  274.  │                                                                       │
  275.  └───────────────────────────────────────────────────────────────────────┘
  276.     
  277.  
  278.     Since object numbers change constantly throughout pad creation, using
  279.     them to refer to objects within a script is not the most reliable
  280.     method. Determine an object's number by opening the Object Info dialog
  281.     box for that object.
  282.  
  283.  
  284.  
  285.     ________________________________________________________________________
  286.                                  Chapter 1: What's Really Happening   11
  287.     ________________________________________________________________________
  288.  
  289.  
  290.     Examples of objects referred to by their number:
  291.  
  292.     set the color of page button 1 to red;
  293.     set the color of field 1 to blue;
  294.     go to page 137;
  295.     go to page 3 of background 4;
  296.  
  297.  
  298.     OBJECT ID NUMBERS
  299.  
  300.     When an object is created (this includes being copied, pasted and
  301.     cloned) HyperPAD assigns it a unique identification number. An object's
  302.     ID number cannot be altered and is never duplicated. Using this number
  303.     to refer to an object in a script is foolproof because it will never
  304.     change.
  305.  
  306.     You can retrieve an object's ID number by opening the Object Info dialog
  307.     box.
  308.  
  309.     Examples of objects being referenced by their IDs:
  310.  
  311.     set the color of page id 5 to red;
  312.     put "wow" into field id 3;
  313.     go to page id 45;
  314.     go to page id 4 of background id 5;
  315.     go to background id 1;
  316.  
  317.  
  318.     READY TO SCRIPT
  319.  
  320.     Now that you have a general introduction to HyperPAD objects, we will
  321.     introduce you to HyperPAD scripts.
  322.